import type { FileInfo } from '@/interface';
import { request } from '../request';

/**
 * 更新用户信息
 * @param data
 * @returns
 */
export function updateUser(data: Auth.UserInfo) {
  return request.post<void>('/admin/user/update', data, { useErrMsg: true });
}

/**
 * 上传头像
 * @param data
 * @returns
 */
export function uploadAvatar(data: FormData) {
  return request.post<FileInfo>('/admin/user/uploadAvatar', data, {
    useErrMsg: true,
    contentType: 'multipart/form-data'
  });
}
